<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<!--view层-->
<div id="app">
  <h1>{{message}}</h1>
  <h1>真正的属性写法为</h1>
  <h2>{{FullName}}</h2>
  <h1>语法糖</h1>
  <h2>{{fullName}}</h2>
</div>
<!--viewModel层-->
<script src="../../js/vue.js"></script>
<!--model层-->
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '计算属性的getter和setter方法,转换成语法糖写法',
      firstname: 'kai',
      lastname: 'zhang'
    }, computed: {

      FullName: {
        set: function (newValue) {
          //计算属性一般set方法不用写,删除,因为没有set方法,所以才有了下边的语法糖,默认get也不写了
        }, get: function () {
          return this.lastname + this.firstname
        }
      },
      fullName: function () {
        return this.lastname + this.firstname
      }
    }, methods: {
      test: function (msg) {
        //声明方法
      }
    }, created: function () {
      //生命周期
    }, mounted: function () {
      //生命周期
    }
  })
</script>
</body>
</html>